package com.example.rabbitmq.consumer;

import com.rabbitmq.client.*;
import com.rabbitmq.client.Consumer;

/**
 * @author weiyx
 * @date 2021-01-16
 */
public class MyConsumer extends DefaultConsumer {

    public MyConsumer(Channel channel) {
        super(channel);
    }

    @Override
    public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties basicProperties,  byte[] body){
        System.out.println("----- consumer message -----");
        System.out.println("consumerTag = " + consumerTag);
        System.out.println("envelope = " + envelope);
        System.out.println("basicProperties = " + basicProperties);
        System.out.println("body = " + new String(body));
    }
}
